using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CoreData;
using Services;
using Helper;
namespace ActionServices
{

    public interface IProductActionService:BaseActionService
    {
        long Save(object _model,ref string mess);
        IList<CoreData.Product> GetListByLINQ(Func<CoreData.Product, Boolean> _where);
        CoreData.Product GetOneByLINQ(Func<CoreData.Product, Boolean> _where);
        bool Delete(object _model);
        string GetProductCodeByGroup(long _groupid);
        IList<CoreData.Product> GetProductInListID(List<long> _listID);
        decimal GetPriceByUnit(long _UnitChangeID,long _ProductID);
        IList<CoreData.Product> GetProductList_frmSelectedProduct(List<long> _ListProductSeletedID, long _Product_ProviderID, string search);
        IList<CoreData.Product> GetProductList_frmSelectedProduct(List<long> _ListProductSeletedID,string search);
        IList<CoreData.Product> GetProductBeginStock_frmSelectedProduct(List<long> _ListProductSeletedID,string search);
        IList<CoreData.Product> GetProductList_StockReport(Product _ProductEntity);
        IList<CoreData.Product> GetProductDetail_StockReport(long ProductID);
    }

    public partial class ProductActionService:IProductActionService
    {
       ProductService Service;

       public ProductActionService()
       {
           Service = new ProductService();
       }

       #region Main Method

       public virtual long Save(object _model, ref string mess)
       {
           return Service.Save(_model,ref mess);
       }

       public virtual object GetByID(long _id)
       {
           return Service.GetByID(_id);
       }

       public virtual object GetList()
       {
           return Service.GetList();
       }

       public virtual IList<CoreData.Product> GetListByLINQ(Func<CoreData.Product, Boolean> _where)
       {
           return Service.GetListByLINQ(_where);
       }

       public virtual CoreData.Product GetOneByLINQ(Func<CoreData.Product, Boolean> _where)
       {
           return Service.GetOneByLINQ(_where);
       }

       public virtual object GetList(string _searchstring)
       {
           return Service.GetList(_searchstring);
       }

       public virtual bool Delete(object _model)
       {
           return Service.Delete(_model);
       }

       #endregion


        #region Other Method
       public virtual string GetProductCodeByGroup(long _groudid)
       {
           return Service.GetProductCodeByGroup(_groudid);
       }
       public virtual IList<CoreData.Product> GetProductInListID(List<long> _listID)
       {
           return Service.GetProductInListID(_listID);
       }
       public virtual IList<CoreData.Product> GetProductList_frmSelectedProduct(List<long> _ListProductSeletedID, long _Product_ProviderID,string search)
       {
           return Service.GetProductList_frmSelectedProduct(_ListProductSeletedID,_Product_ProviderID, search);
       }
       public virtual IList<CoreData.Product> GetProductList_frmSelectedProduct(List<long> _ListProductSeletedID, string search)
       {
           return Service.GetProductList_frmSelectedProduct(_ListProductSeletedID, search);
       }
        //Lay san phan cho form Khoi tao ton dau
       public virtual IList<CoreData.Product> GetProductBeginStock_frmSelectedProduct(List<long> _ListProductSeletedID,string search)
       {
           return Service.GetProductBeginStock_frmSelectedProduct(_ListProductSeletedID, search);
       }
       public virtual IList<CoreData.Product> GetProductList_StockReport(Product _ProductEntity)
       {
           return Service.GetProductList_StockReport(_ProductEntity);
       }
       public virtual IList<CoreData.Product> GetProductDetail_StockReport(long ProductID)
       {
           return Service.GetProductDetail_StockReport(ProductID);
       }
       public virtual decimal GetPriceByUnit(long _UnitChangeID,long _ProductID)
       {
           return Service.GetPriceByUnit(_UnitChangeID,_ProductID);
       }
        #endregion

    }
         
}
